package com.zhengxing.jienci.web.config;

import javax.servlet.Filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.zhengxing.jienci.web.filter.CurrentUserProcessorFilter;

@Configuration
public class FilterConfig {
	
	@Bean
	public FilterRegistrationBean<Filter> loginUserProcessFilter() {
		FilterRegistrationBean<Filter> filterRegistrationBean = new FilterRegistrationBean<Filter>();
		CurrentUserProcessorFilter currentUserProcessorFilter = new CurrentUserProcessorFilter();
		filterRegistrationBean.setFilter(currentUserProcessorFilter);
		filterRegistrationBean.addUrlPatterns("/*");
		return filterRegistrationBean;
	}
}
